查看原文
其他

用 LaTeX 做笔记是怎样的体验?体验下运笔如飞写笔记的感觉

texer LaTeX工作室 2024-04-20

用 LaTeX 做笔记,尤其是对笔记排版有较高要求,或者经常需要写数学公式,那么 LaTeX 是一个值得考虑的选择。使用 LaTeX 来做笔记是一个既高效又可以提升文档质量的体验。LaTeX 的优势在于其强大的排版能力和对数学公式的支持,以下是我能想到的使用 LaTeX 做笔记的一些优越性:

  • 强大的数学公式支持 对于需要记录复杂数学公式的笔记,LaTeX 提供了无与伦比的排版效果支持。无论是简单的代数表达式还是复杂的积分方程,LaTeX 都能够轻松应对。

  • 一致性和可维护性 LaTeX 的一个显著特点是其在文档中保持格式一致性的能力。使用宏包和文档类,你可以确保所有笔记的外观和格式都是统一的,这对于长期维护和查阅笔记非常有用。

  • 跨平台兼容性 LaTeX 是跨平台的,这意味着你可以在任何操作系统上编辑和查看你的笔记,而不用担心格式问题。

  • 版本控制和协作 LaTeX 文件的文本性质使得它们可以轻松地与版本控制系统(如 Git)配合使用,这对于笔记的版本管理和协作非常有帮助。

  • 转换和发布 LaTeX 文档可以轻松地转换成各种格式,包括 PDF、HTML等。这使得你的笔记不仅可以在 LaTeX 环境中查看,还可以在其他平台上共享和发布。

使用 LaTeX 做笔记可能需要一些学习和适应,但长远来看,它能够极大地提升笔记的质量和可管理性。

下面分享两位大神的超级体验吧。

一个知乎大神的笔记体验

本篇回答陆陆续续受到了一些关注,于是我想把这部分的内容完善一些,以期成为一个比较成熟的模板给大家参考,从各位答主那边学到了很多,也结合了一些个人想法和使用经验进行了一番设计设计。这篇回答除了关于笔记模板的定制部分,还涉及一些 Tikz 绘图的案例。涉及的所有代码都在本篇回答的末尾给出。

笔记的环境主要是用宏包 tcolorbox 定制的,这个包的功能非常强大。笔记色调以蓝色为主,代码中的导言区给出了一些我在配色网站上寻找到的颜色,大家有需要可以自行修改。

有人提到的 LaTeX 效率低、速度慢等,我觉得这个属于熟练度和工具的问题。本人编译的环境是TeX Live2019+Win10,用的平台是 VsCode 。配合 snippets 和一些自定义环境,效率会有所提高。

特殊环境

定义被环境左侧的视觉引导线包裹,证明结束的标志是实心的小正方形,定理和例题的分别是灯泡和图钉。这样,正文和一些特殊环境总是能够区分开来。

标题

img

标题定义的方法是从一些知乎回答那里学到的,如果感兴趣可以作更深入的了解,这里附上链接。

定理

img
img

定义

img

证明

img

习题

img

例题

img

常用命令

公式标注

img

主要用到 TikZtikzmark ,可以参考这篇文章[3]。但是这种标注方法要编译两次,我在使用过程中也发现了一些小问题,比如如果标注的公式处在页面最顶部或最底部,这个标注的内容会出现在下一页。还有就是如果公式在一行中太长,出现了 overfull box 的提示,标注的位置会出现一些偏移。

自定义序号列表

img

有关序号定义,这两篇文章可以参考一下[4][5]。

文字标签

这个标签样式使用 tcolorbox 定制的,模仿的是 Notion 的标签样式。其实用 [tikz node](https://www.zhihu.com/search?q=tikz node&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra={"sourceType"%3A"answer"%2C"sourceId"%3A2484792198}) 也能做出这样的效果。

img

Tikz 绘图示例

img

黎曼积分示意图

img

三角函数

img
img
img

旋转体的体积

img
img

附录:代码

最后附上本回答的所有代码,如果以后有时间会慢慢把一些定义中的细节再阐述一下。复制后直接用 XeLaTeX 编译两次即可。

\documentclass[UTF8]{ctexart}
\usepackage{geometry}
\usepackage{amsmath,mathtools,mathdots,extarrows,psfrag,lipsum,array}
\usepackage{xcolor}
\usepackage{tikz,pgfplots,tcolorbox,graphicx}
\usepackage{caption,subcaption}
\usepackage{amssymb}
\usepackage{booktabs}
\usepackage{bm}
\usepackage{enumitem}
\usepackage{multicol,multirow}
%符合国标gbt7714的引用范式
\usepackage{gbt7714}
%目录的链接
\usepackage[hidelinks]{hyperref}
%常用的图案,用于区分定理、例题结束的标记
\usepackage{typicons}
%宏包{breqn}和tikz包{tikzmark}相互冲突,使用前者后会在后者的命令下反复报错'pgf cannot find shape a'之类.
%%%%%%%%%%%%%%new command/environment%%%%%%%%%%%%
\allowdisplaybreaks

\newcommand*\enumlabel[1]{
    \tikz[baseline=(char.base)]{\node[shape=rectangle,inner sep=2pt,fill=Blue] (char) {{\textcolor{white}{#1}
}};
    }
}

\newcommand*\enulabel[1]{
    \tikz[baseline=(char.base)]{\node[shape=rectangle,inner sep=2pt] (char) {{\textcolor{Blue}{#1}
}};
    }
}

\newcommand*\zheng{
    \tikz[baseline=(char.base)]{\node[shape=rectangle,inner sep=0pt] (char) {{\bfseries\heiti\textcolor{Light_Yellow}{证明:}
}};
    }
}

\newcommand*\jie{
    \tikz[baseline=(char.base)]{\node[shape=rectangle,inner sep=0pt] (char) {{\bfseries\heiti\textcolor{Blue}{解:}
}};
    }
}
%%%%%%%%%%%%%%%%%%graphic settings%%%%%%%%%%%%%%%%
\tcbuselibrary{external,breakable,skins}
\usetikzlibrary{decorations.pathreplacing,positioning,shapes.misc,decorations.markings,calc,intersections,arrows.meta,graphs,shapes.misc,decorations.pathmorphing,decorations.shapes,tikzmark,angles,quotes}
\geometry{b5paper,centering,scale=0.8,left=2cm,right=2cm,bottom=2cm,top=2.5cm}
\tikzset{every picture/.style={>=Latex}}
%%%%%%%%%%%%%%%%%%%fonts settings%%%%%%%%%%%%%%%%%
\setmainfont{Times New Roman}
\setsansfont{Georgia}
\setmonofont{Arial}
%%%%%%%%%%%%%%%%%%chapter settings%%%%%%%%%%%%%%%%
\ctexset{
    section={
    format+=\sectionFormat,
    titleformat=\tcblower,
    aftertitle=\end{tcolorbox}

    },
    subsection={
    format+=\sectionFormatt,
    titleformat=\tcblower,
    aftertitle=\end{tcolorbox}
    },
    subsubsection={
    format+=\sectionFormattt,
    titleformat=\tcblower,
    aftertitle=\end{tcolorbox}
    }
    }
\newcommand\sectionFormat[1]{
\begin{tcolorbox}[colback=Cream_4!10,
    colframe=white,leftrule=0mm,sharp corners,toprule=0mm,bottomrule=0mm,rightrule=0mm,sidebyside,lefthand ratio=0.1,colupper=Blue,collower=Blue,fontupper=\LARGE,fontlower=\LARGE,lower separated=false]

#1
}
\newcommand\sectionFormatt[1]{
\begin{tcolorbox}[colback=white,
    colframe=white,leftrule=0mm,sharp corners,toprule=0mm,bottomrule=0mm,rightrule=0mm,sidebyside,lefthand ratio=0.05,colupper=Blue,collower=Blue,fontupper=\Large,fontlower=\Large,lower separated=false,size=minimal,beforeafter skip=1em]

#1
}
\newcommand\sectionFormattt[1]{
\begin{tcolorbox}[colback=white,
    colframe=white,sharp corners,leftrule=0mm,toprule=0mm,bottomrule=0mm,rightrule=0mm,sidebyside,lefthand ratio=0.05,colupper=Blue,collower=Blue,fontupper=\large,fontlower=\large,lower separated=false,size=minimal,beforeafter skip=1em]

#1
}
%%%%%%%%%%%%%%%%%tcolorbox settings%%%%%%%%%%%%%%%

\newtcolorbox{prf}[1][]{fonttitle=\bfseries\heiti,colback=white,coltitle=white,breakable,enhanced,attach boxed title to top left={xshift=10mm},sharp corners,title={证明},after title={#1},size=fbox,after upper=\hfill$\blacksquare $,frame hidden,boxed title style={colback=Vintage_3,colframe=Vintage_3,sharp corners},
overlay unbroken={
    \draw[Vintage_3,line width=0.5mm] (title.west) -- ([yshift=\tcboxedtitleheight/2]frame.north west) -- (frame.south west) -- (frame.south east);},
overlay first={
    \draw[Vintage_3,line width=0.5mm] (title.west) -- ([yshift=\tcboxedtitleheight/2]frame.north west) -- (frame.south west);},
overlay middle={
    \draw[Vintage_3,line width=0.5mm] (frame.north west)--(frame.south west);},
overlay last={
    \draw[Vintage_3,line width=0.5mm] (frame.north west)--(frame.south west)--(frame.south east);}
}

\newtcolorbox{theorem}[1][]{fonttitle=\bfseries\heiti,colback=white,frame hidden,breakable,title=#1,enhanced,attach boxed title to top left={xshift=10mm},sharp corners,
boxed title style={coltitle=white,colback=Blue,colframe=Blue,sharp corners},
overlay unbroken={
    \draw[Blue,line width=0.5mm] (title.west) -- ([yshift=\tcboxedtitleheight/2]frame.north west) -- (frame.south west) -- (frame.south east);},
overlay first={
    \draw[Blue,line width=0.5mm] (title.west) -- ([yshift=\tcboxedtitleheight/2]frame.north west) -- (frame.south west);},
overlay middle={
    \draw[Blue,line width=0.5mm] (frame.north west)--(frame.south west);},
overlay last={
    \draw[Blue,line width=0.5mm] (frame.north west)--(frame.south west)--(frame.south east);}
}

\newtcolorbox[auto counter,number within=section]{definition}[1][]{enhanced,frame hidden,colback=white,coltitle=Blue,fonttitle=\bfseries,title={定义~\thetcbcounter},detach title,before upper={\tcbtitle\quad},after title={\quad#1},breakable,sharp corners,borderline west={1mm}{0mm}{Cream_3}}

\newtcolorbox{case}{enhanced,colframe=Lake_Blue!10,colback=Lake_Blue!10,sharp corners,breakable,borderline west={1mm}{0mm}{Lake_Blue}}

\newtcolorbox[auto counter,number within=section]{liti}[1][]{colback=white,coltitle=Blue,frame hidden,breakable,before skip=1cm,title=错题回顾 \thetcbcounter,enhanced,attach boxed title to top left,sharp corners,fonttitle=\LARGE\heiti,
boxed title style={empty,colframe=Blue,size=minimal,overlay={\draw[Blue,line width=2pt]([yshift=2pt]frame.north west)--([yshift=2pt]frame.north east);}
},
overlay unbroken={
    \draw[Blue,line width=1pt] ([yshift=2pt]title.north west) -- ([yshift=\tcboxedtitleheight+2pt]frame.north east);
    \draw[Blue,line width=1pt] (frame.south west)--(frame.south east);},
overlay first={
    \draw[Blue,line width=1pt] ([yshift=2pt]title.north west) -- ([yshift=\tcboxedtitleheight+2pt]frame.north east);},
overlay last={
    \draw[Blue,line width=1pt] (frame.south west)--(frame.south east);}
}

\newtcbox{\txe}[1][]{on line,arc=1pt,colback=#1!30,colframe=white,colupper=black,boxrule=0pt,boxsep=0pt,left=0pt,right=3pt,top=0pt,bottom=0pt}

\newtcolorbox[auto counter]{examp}[1][]{enhanced,frame hidden,colback=white,coltitle=Blue,fonttitle=\bfseries,title={例~\thetcbcounter},detach title,before upper={\tcbtitle},after title={\quad#1},breakable,sharp corners,size=minimal,
overlay unbroken={
    \node [yshift=0.5em] at (frame.south east) {\Large\color{Blue}\tiPinOutline};},
overlay last={
    \node [yshift=0.5em] at (frame.south east) {\Large\color{Blue}\tiPinOutline};}}

\newtcolorbox[auto counter]{ttheorem}[1][]{enhanced,frame hidden,colback=white,coltitle=Blue,title={\bfseries 定理~\thetcbcounter},detach title,before upper={\tcbtitle},after title={\heiti#1\quad},breakable,sharp corners,beforeafter skip=0.5em,size=minimal,
overlay unbroken={
    \node [yshift=0.5em] at (frame.south east) {\Large\color{Blue}\tiLightbulb};},
overlay last={
    \node [yshift=0.5em] at (frame.south east) {\Large\color{Blue}\tiLightbulb};}}

%%%%%%%%%%%%%%%%%%Color Definition%%%%%%%%%%%%%%%%
\definecolor{Light_Yellow}{HTML}{CF7F19}
\definecolor{Light_Green}{HTML}{007C63}
\definecolor{Lake_Blue}{HTML}{7192C5}
\definecolor{Blue}{HTML}{2e9ce9}
%Nature
\definecolor{Nature_1}{HTML}{F4FCD9}
\definecolor{Nature_2}{HTML}{C5D8A4}
\definecolor{Nature_3}{HTML}{BB9981}
\definecolor{Nature_4}{HTML}{534340}
%Vintage
\definecolor{Vintage_1}{HTML}{E5E3C9}
\definecolor{Vintage_2}{HTML}{B4CFB0}
\definecolor{Vintage_3}{HTML}{94B49F}
\definecolor{Vintage_4}{HTML}{789395}
%Cream
\definecolor{Cream_1}{HTML}{F7FBFC}
\definecolor{Cream_2}{HTML}{D6E6F2}
\definecolor{Cream_3}{HTML}{B9D7EA}
\definecolor{Cream_4}{HTML}{769FCD}

\title{\LaTeX{} Notes}
\author{知乎@可达可达}
\date{}

\begin{document}
\maketitle
\tableofcontents
\clearpage
\section{特殊环境}
\subsection{定理}
\subsubsection{中心极限定理}
\begin{theorem}[De Moivre-Laplace中心极限定理]
    设 $\mu_n$ 为 $n$ 重Bernoulli实验中事件 $A$ 发生的次数,$p$ 为每次实验中 $A$ 发生的概率,则对任意的 $x\in \mathbb{R}$,有
\begin{equation*}
        \lim_{n \to \infty}P\left(\frac{\mu_n-np}{\sqrt{np(1-p)}}\leqslant x \right)=\int_{-\infty}^{x}\frac{1}{\sqrt{2\pi}}e^{-\frac{t^2}{2}}  \,dt
\end{equation*}
\end{theorem}

\subsubsection{向量组的线性相关}
\begin{ttheorem}
    向量组 $\alpha_1,\alpha_2,\dots,\alpha_s,(s \geqslant 2)$ 线性无关的充分必要条件是向量组中的每个向量都不能由其余向量线性表示.
\end{ttheorem}

\begin{ttheorem}
    如果向量组 $\alpha_1,\alpha_2,\dots,\alpha_s$ 线性无关,而向量组 $\alpha_1,\alpha_2,\dots,\alpha_s,\beta$ 线性相关,则向量 $\beta$ 可由向量组 $\alpha_1,\alpha_2,\dots,\alpha_s,(s \geqslant 2)$ 线性表示,并且表达式唯一.
\end{ttheorem}

\begin{ttheorem}
    如果向量 $\beta$ 可由向量组 $\alpha_1,\alpha_2,\dots,\alpha_s$ 线性表示,则 $r(\alpha_1,\alpha_2,\dots,\alpha_s)=r(\alpha_1,\alpha_2,\dots,\alpha_s,\beta)$
\end{ttheorem}

\begin{ttheorem}[(积分判别法)]
    设 $f(x)$ 是 $[1,+\infty]$ 上连续、递减的正值函数,又 $u_n=f(n)$,则 $\sum^{\infty}_{n=1} u_n$ 和广义积分 $\int_{1}^{+\infty} f(x) \,\mathrm{d}x $ 同时收敛或同时发散.
\end{ttheorem}

\begin{ttheorem}[(Leibniz定理)]
    如果交错级数 $\sum^{\infty}_{n=1} (-1)^{n-1}u_n$ 满足 $u_n \geqslant u_{n+1}$ 且 $\lim_{n \to +\infty} =0$.则级数收敛,且其和 $S \leqslant u_1$,其余项 $\left\lvert r_n\right\rvert \leqslant u_{n+1}$.
\end{ttheorem}
\subsection{定义}
\begin{definition}
    设 $(X,Y)$ 为二维随机向量,且 $X,Y$ 的方差均为正,则称 $\frac{Cov(X,Y)}{\sigma_X\sigma_Y}$ 为 $X$ 与 $Y$ 的相关系数,记为 $\rho _{XY}$ 或简记为 $\rho $,即\[
    \rho _{XY}=\frac{Cov(X,Y)}{\sigma_X\sigma_Y}=\frac{E[(X-\mu_X)(Y-\mu_Y)]}{\sigma_X\sigma_Y}.
    \]
\end{definition}

\clearpage
\subsection{证明}
\begin{prf}[$\sum^{n}_{i=1}(x_i-\bar{x})(y_i-\bar{y})=\sum^{n}_{i=1}x_i(y_i-\bar{y})$]
    \begin{align*}
    \sum^{n}_{i=1}(x_i-\bar{x})(y_i-\bar{y})&=\sum^{n}_{i=1}(x_iy_i-\bar{y}x_i-\bar{x}y_i+\bar{x}\bar{y}\\
    &=\sum^{n}_{i=1}x_iy_i-\bar{y}\sum^{n}_{i=1}x_i-\bar{x}\sum^{n}_{i=1}y_i+n\bar{x}\bar{y}=\sum^{n}_{i=1}x_iy_i-n\bar{x}\bar{y} \\
    &=\sum^{n}_{i=1}x_i(y_i-\bar{y}).
    \end{align*}
\end{prf}

\subsection{习题}

\begin{liti}
    \begin{enumerate}[label=\protect\enumlabel{\thetcbcounter-\arabic*}, leftmargin=2em]
        \item 1+1=
        \item 1+2=
        \item 1+3=

        $\dotsb$
    \end{enumerate}
\end{liti}

\subsection{例题}
\begin{examp}{设 $0<a<b<1,$ 证明:$\arctan b-\arctan a<\frac{b-a}{2ab}.$}
    \par \jie 构造 $
f(x)=\arctan x.$ 由拉格朗日中值定理,存在 $\xi \in (a,b),f'(\xi)=\frac{f(b)-f(a)}{b-a}\implies \frac{1}{1+\xi^2}=\frac{\arctan b-\arctan a}{b-a},\frac{1}{1+\xi^2}<\frac{1}{1+a^2}<\frac{1}{b^2+a^2}<\frac{1}{2ab}\implies \arctan b-\arctan a<\frac{b-a}{2ab}.$
\end{examp}
\begin{examp}{设 $f(x)$ 在 $(a,b)$ 内二阶可导,且 $f''(x)>0$,证明对于任意的 $x_1,x_2 \in (a,b)$,且 $x_1\neq x_2$ 且及 $\lambda(0<\lambda<1)$,恒有 $f[\lambda x_1+(1-\lambda)x_2]<\lambda f(x_1)+(1-\lambda)f(x_2).$}
    \par \zheng 不妨设 $
x_1<x_2$,令 $\mu=\lambda x_1+(1-\lambda)x_2=\lambda(x_1-x_2)+x_2,$ 故 $x_1<\mu<x_2.$ 存在 $\xi_1 \in (x_1,\mu),f'(\xi_1)=\frac{f(\mu)-f(x_1)}{(\lambda-1)(x_1-x_2)},\xi_2 \in (\mu,x_2),f'(\xi_2)=\frac{f(x_2)-f(\mu)}{\lambda(x_2-x_1)}.$ 由 $f''(x)>0\implies f'(\xi_2)>f'(\xi_1).$ 整理得 $f[\lambda x_1+(1-\lambda)x_2]<\lambda f(x_1)+(1-\lambda)f(x_2).$
\end{examp}
\clearpage
\section{常用命令}
\subsection{公式标注}
\begin{equation}
    \tikzmarknode[fill=Blue!20]{d1}{f'(x)}+f(x) \tikzmarknode[fill=Blue!20]{d2}{\varphi '(x)} \xrightarrow{\text{构造}} f(x)\tikzmarknode[fill=Blue!20]{d8}{e^{\varphi (x)}}
\end{equation}
\tikz[remember picture,overlay]{\draw[thick,Blue] (d2.south) --++(0,-1em) --++(2cm,0) node[right](){$\bigstar $ 化简后出现一个共同的系数};}
\subsection{自定义序号列表}
常用的几个积分公式:
\begin{align*}
    \enulabel{1.} &\int k \,\mathrm{d}x=kx+C&
    \enulabel{2.} &\int x^\alpha\,\mathrm{d}x=\frac{x^{\alpha+1}}{\alpha+1}+C (\alpha\neq -1)\\
    \enumlabel{3.} &\int\frac{1}{x}\,\mathrm{d}x=\ln\left\lvert x\right\rvert +C&
    \enumlabel{4.} &\int a^x\,\mathrm{d}x=\frac{a^x}{\ln a}+C\\
\end{align*}
\subsection{文字标签}
\begin{table}[]
    \begin{tabular}{@{}cccc@{}}
    \toprule
    \textbf{书名} & \textbf{作者}   & \textbf{出版社}                                                               & \textbf{出版时间} \\ \midrule
    微观经济学:现代观点  & 哈尔·R.范里安      & \begin{tabular}[c]{@{}c@{}}\txe[Nature_1]{上海三联书店}\\      \txe[Nature_2]{上海人民出版社}\\      \txe[Nature_3]{格致出版社}\end{tabular} & 2015          \\
    宏观经济学       & N·格里高利·曼昆     & \txe[Vintage_4]{中国人民大学出版社}                                                                  & 2020          \\
    经济增长        & 罗伯特.J.巴罗      & \txe[Nature_3]{格致出版社}                                                                      & 2010          \\
    投资学         & 滋维·博迪         & \txe[Vintage_2]{机械工业出版社}                                                                    & 2017          \\
    线性代数应该这样学   & Sheldon Axler & \txe[Vintage_3]{人民邮电出版社}                                                                    & 2016          \\ \bottomrule
    \end{tabular}
\end{table}
\section{Tikz绘图示例}
\begin{figure}[htp]
    \centering
    \begin{tikzpicture}
        \draw[->] (0,0) -- (5,0);
        \draw[thick,Vintage_4,domain=1:4,name path=func] (0.5,2) .. controls (2.5,0) and (3,5) .. (4.5,3);
        \draw[Vintage_4] (0.5,0) node[below] {$
a$} -- (0.5,2) (4.5,0) node[below] {$b$} -- (4.5,3);
        \foreach \min in {0.75,1,1.25,1.5,...,4.5}
            {\path[name path=agg] (\min,0) -- (\min,5);
            \path[name path=ag] (\min-0.25,0) -- (\min-0.25,5);
            \draw[Vintage_4,name intersections={of=agg and func, by=point},name intersections={of=ag and func, by=pnt},Vintage_4] let \p1 = (point), \p2=(pnt) in (\min,0) -- (point) -- (\x2,\y1) -- (pnt);
            }
        \path[name path=ab] (3.5,0) node[Vintage_4,below] {$
i$} -- (3.5,5);
        \draw[name intersections={of=ab and func, by=point},decorate,decoration={brace,amplitude=3pt,mirror,raise=2pt}] (3.5,0) --node[xshift=5pt,right]{$
f(a+\frac{b-a}{n}\cdot i)$} (point);
        \draw[Vintage_4,name intersections={of=ab and func, by=point},decorate,decoration={brace,amplitude=3pt,mirror,raise=2pt}] (2.5,0) --node[below,yshift=-2pt]{$
\frac{b-a}{n}$} (2.75,0);
        \fill[Vintage_4,opacity=0.2](3.5,0) circle (1pt);
    \end{tikzpicture}
    \caption{黎曼积分的示意图}\label{riemann}
\end{figure}
\begin{figure}[htp]
\centering
\begin{tikzpicture}[baseline=(char.base)]
    \node(char) at (0,0) {};
    \draw(0.5,-0.8) coordinate (A)--(3.5,-0.8) coordinate (B)--(3.5,0.8) coordinate (C)--cycle pic ["$
t$",draw,angle radius=0.5cm,angle eccentricity=1.5] {angle = B--A--C};
    \node (cha) at ($
(0.5,-1)!0.5!(3.5,-1)$) [below] {$\sqrt{a^2-x^2}$};
    \node (cha) at ($
(3.5,-0.8)!0.5!(3.5,0.8)$) [right] {$x$};
    \node (cha) at ($
(0.5,-1)!0.5!(3.5,0.8)$) [above] {$a$};
    \node (cha) at (0.5,0) [align=left,above] {$
\sin t=\frac{x}{a}$\\$\tan t=\frac{x}{\sqrt{a^2-x^2}}$\\$\cos t=\frac{\sqrt{a^2-x^2}}{a}$};
\end{tikzpicture}
\end{figure}

\begin{tikzpicture}
    \fill [fill = Vintage_4,fill opacity=0.5] (0.5,2) .. controls (1,0) and (1.5,3) .. (2.5,2) -- (2.5,0.5) -- (2.5,0.5) .. controls (1.5,1) and (1,0) .. (0.5,0.5) -- (0.5,2);
    \draw [->] (0,-0.5) -- (0,3) node[left] {$
Y$};
    \draw [->] (-0.5,0) -- (3,0) node[below] {$
X$};
    \draw [Vintage_4,thick] (0.5,2) .. controls (1,0) and (1.5,3) .. (2.5,2);
    \draw [Vintage_4,thick] (0.5,0.5) .. controls (1,0) and (1.5,1) .. (2.5,0.5);
    \draw [dashed] (0.5,0) node[below] {$
a$} -- (0.5,2) (2.5,0) node[below] {$b$} -- (2.5,2);
\end{tikzpicture}
\begin{tikzpicture}
    \fill [fill = Vintage_4,fill opacity=0.5] [domain=0.2:1,smooth] plot(\x,{ln(\x)}) -- (0.2,0) -- cycle;
    \fill [fill = Vintage_4,fill opacity=0.5] [domain=1:2.5,smooth] plot(\x,{ln(\x)}) -- (2.5,0) -- cycle;
    \draw [->] (0,-1.75) -- (0,1.75) node[left] {$
Y$};
    \draw [->] (-0.5,0) -- (3,0) node[below] {$
X$};
    \draw [Vintage_4,domain=0.2:2.5,smooth] plot(\x,{ln(\x)});
    \draw [Vintage_4,domain=0.2:1,smooth,dashed] plot(\x,{-ln(\x)});
\end{tikzpicture}
\begin{tikzpicture}
    \fill [fill = Vintage_4,fill opacity=0.5] [domain=0.2:2.5,smooth] plot(\x,{-0.35*(\x-0.5)^2+1.5}) -- (2.5,{-0.1*(2.5-0.5)^2+1}) [domain=2.5:0.2,smooth] -- plot(\x,{-0.1*(\x-0.5)^2+1}) -- cycle;
    \fill [fill = Vintage_4,fill opacity=0.3] [domain=0.2:2.5,smooth] plot(\x,{0.35*(\x-0.5)^2-1.5}) -- (2.5,{0.1*(2.5-0.5)^2-1}) [domain=2.5:0.2,smooth] -- plot(\x,{0.1*(\x-0.5)^2-1}) -- cycle;
    \draw [->] (0,-1.75) -- (0,1.75) node[left] {$
Y$};
    \draw [->] (-0.5,0) -- (3,0) node[below] {$
X$};
    \draw [Vintage_4,domain=0.2:2.5,smooth] plot(\x,{-0.35*(\x-0.5)^2+1.5});
    \draw [Vintage_4,domain=0.2:2.5,smooth] plot(\x,{-0.1*(\x-0.5)^2+1});
    \draw [Vintage_4,domain=0.2:2.5,smooth,dashed] plot(\x,{0.35*(\x-0.5)^2-1.5});
    \draw [Vintage_4,domain=0.2:2.5,smooth,dashed] plot(\x,{0.1*(\x-0.5)^2-1});
    \draw [dashed] (0.2,{0.35*(0.2-0.5)^2-1.5}) -- (0.2,0) node[below] {$
a$} -- (0.2,{-0.35*(0.2-0.5)^2+1.5}) (2.5,{0.35*(0.2-0.5)^2-1.5}) -- (2.5,0) node[below] {$b$} -- (2.5,{-0.35*(0.2-0.5)^2+1.5});
\end{tikzpicture}
\end{document}

参考

  1. ^https://zhuanlan.zhihu.com/p/392619305
  2. ^https://zhuanlan.zhihu.com/p/84571492
  3. ^https://zhuanlan.zhihu.com/p/493767981
  4. ^https://www.zhihu.com/question/460821113/answer/1911547041
  5. ^https://www.zhihu.com/question/457373199/answer/1993878551

作者:可达可达

链接:https://www.zhihu.com/question/362654946/answer/2484792198

国外大神的 1700 页笔记,爆红,运笔如飞

鲁汶大学纯数学博士 Gilles Castel 写的关于使用 Vim 和 LaTex 写笔记的博客,他在数学学士学位的第二学期开始使用 LaTeX 编写讲义,大学四年他自称写了 1700 多页。大概类似这种:

其介绍内容在:https://castel.dev/post/lecture-notes-1/

数学课上,全程键盘手打 1700 页笔记。速度紧追老师板书,公式、图形一个不落。

不仅排版媲美教科书,而且还能够批注,检索关键词……

笔记被他 Po 到网上之后,便引来大量围观。

甚至有网友评论称:“你就是我们需要的英雄!”

他是怎么做到的呢?秘密武器就是:LaTeX+Vim!

Vim 可以设置代码模块:输入简单的关键字按 tab 键生成经常需要重用的字段。于是输入 LaTex 就可以这样:

用LaTeX记笔记,怎么才能像老师写板书一样快?

这就是片段(snippets)发挥作用地方了。片段是一小段可复用的文本,由其他文本触发。

例如,输入sign,再按下Tab键,这个单词就会自动扩展为一段签名:

片段也可以是动态的:输入today并按下Tab键,它就会变成当前的日期。


而输入box按Tab,就会出现一个框,还会随着输入文字自动变大。

片段,甚至可以嵌套在另一个片段里用.

下面来看 LaTeX 的公式编辑。

  • \begin ... \end 环境

  • 行内公式和行间公式

甚至还能这样:结合 Sympy 和 Mathematica 计算表达式

来感受一下输入公式的畅快感!!!

怎么样,大神的世界就是这样的奇幻,迷人, LaTeX 的世界也更加有魅力,等你加入。

关注我们公众号,学习 LaTeX 无烦恼!

入门资料,免费知识代码:

https://flowus.cn/latex/share/66110e84-b24a-4cd5-b8a7-2ba2afb35a30

精心制作免费视频教程:

https://space.bilibili.com/209746320

继续滑动看下一个
向上滑动看下一个

您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存